/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 * Origin source from MaNGOS(GPL2).
 * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
 */

#ifndef __OBJECT_MANAGER_H__
#define __OBJECT_MANAGER_H__

#include "Common.h"

namespace PQCore
{
	#define MAX_PLAYER_NAME          12                         // max allowed by client name length
	#define MAX_INTERNAL_PLAYER_NAME 15                         // max server internal player name length ( > MAX_PLAYER_NAME for support declined names )
	#define MAX_PET_NAME             12                         // max allowed by client name length
	#define MAX_CHARTER_NAME         24                         // max allowed by client name length

	class ObjectManager
	{
	public:
		typedef std::vector<LocaleConstant> LocaleVector;

	public:
		static ObjectManager& getSingleton()
		{
			static ObjectManager inst;
			return inst;
		}

		void SetHighestGuids();

		//bool LoadPQCoreStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
		bool LoadPQCoreStrings();

		bool LoadScriptNames();

		bool LoadInstanceTemplate();

		bool PackGroupIds();

		bool LoadCreatureLocales();

		bool LoadGameObjectLocales();
		bool LoadItemLocales();
		bool LoadQuestLocales();
		bool LoadNpcTextLocales();
		bool LoadPageTextLocales();
		bool LoadGossipMenuItemsLocales();
		bool LoadPointOfInterestLocales();
		bool SetDBCLocaleIndex(int lang);
		bool LoadPageTexts();
		bool LoadGameobjectInfo();
		bool LoadGossipText();
		bool LoadItemPrototypes();
		bool LoadCreatureModelInfo();
		bool LoadEquipmentTemplates();
		bool LoadCreatureTemplates();
		bool LoadCreatureModelRace();
		bool LoadItemRequiredTarget();
		bool LoadReputationRewardRate();
		bool LoadReputationOnKill();
		bool LoadReputationSpilloverTemplate();
		bool LoadPointsOfInterest();
		bool LoadCreatures();
		bool LoadCreatureAddons();
		bool LoadCreatureRespawnTimes();
		bool LoadGameobjects();
		bool LoadGameobjectRespawnTimes();
		bool LoadWeatherZoneChances();
		bool LoadQuests();
		bool LoadQuestPOI();
		bool LoadQuestRelations();
		bool LoadNPCSpellClickSpells();
		bool LoadAreaTriggerTeleports();
		bool LoadQuestAreaTriggers();
		bool LoadTavernAreaTriggers();
		bool LoadAreaTriggerScripts();
		bool LoadEventIdScripts();
		bool LoadGraveyardZones();
		bool LoadPlayerInfo();
		bool LoadExplorationBaseXP();
		bool LoadPetNames();
		bool LoadPetNumber();
		bool LoadPetLevelInfo();
		bool LoadCorpses();
		bool LoadMailLevelRewards();
		bool LoadFishingBaseSkillLevel();
		bool LoadGuilds();
		bool LoadArenaTeams();
		bool LoadGroups();
		bool LoadReservedPlayersNames();
		bool LoadGameObjectForQuests();
		bool LoadGameTele();
		bool LoadNpcTextId(); 
		bool LoadGossipScripts();
		bool LoadGossipMenu();
		bool LoadGossipMenuItems();
		bool LoadVendors();
		bool LoadTrainerSpell();
		bool LoadCreatureMovementScripts();
		bool ReturnOrDeleteOldMails(bool serverUp);
		bool LoadQuestStartScripts();
		bool LoadQuestEndScripts();
		bool LoadSpellScripts();
		bool LoadGameObjectScripts();
		bool LoadEventScripts();
		bool LoadDbScriptStrings();

		int getLocaleIndex(LocaleConstant loc);
	private:
		LocaleVector _locales;
	};

}

#define SObjectMgr PQCore::ObjectManager::getSingleton()

#endif
